/*
*   Grupo 2:		Ana Elisa Siena			7126563
*                       Larissa Zimmermann		7126879
* 
*   Jogo em Java - AngryBirds
*   SCC - 604 - Programação Orientada a Objetos
*   Prof. Fernando V. Paulovich
*   Engenharia de Computação 010 - USP - São Carlos
*   Segundo Semestre de 2011 
*	
*/


package angrybirds.colisao;

import angrybirds.personagens.Personagem;
import org.newdawn.slick.Animation;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SpriteSheet;
import org.newdawn.slick.geom.Shape;
import org.newdawn.slick.geom.Vector2f;

/**********************************************************************************
*	Nome da classe:     Colisao
*	O que faz:          Ela é responsável pela colisão entre porcos e passaros          		
***********************************************************************************/

public class Colisao extends Personagem implements InterfaceColisao{
    
    private Shape collisionShape;
    private int collisionType;
    
    public Colisao(String name, Animation anime, SpriteSheet image, Vector2f position, Shape collisionShape, int collisionType) {	
        super(name, anime, image, position);
        this.collisionShape = collisionShape;
	this.collisionType = collisionType;
    }
        	
    @Override
    public void setPosition(Vector2f position){
	super.setPosition(position);
    }
    
    public Vector2f getPosition(Vector2f position){
        return super.getPosition();
    }
    
    @Override
    public Shape getNormalCollisionShape() {
        return this.collisionShape;
    }

    @Override
    public Shape getCollisionShape() {
        return this.collisionShape;
    }

    @Override
    public int getCollisionType() {
        return this.collisionType;
    }
    
    @Override
    public void render(Graphics graphics) {
	super.render(graphics);
    }

    @Override
    public boolean isCollidingWith(InterfaceColisao collidable) {
        return this.getCollisionShape().intersects(collidable.getCollisionShape());
    }

    public float getPositionX() {
        return super.getPosition().x;
    }

    public float getPositionY() {
        return super.getPosition().y;
    }
    
}